<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: File类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_file-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">File类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>文件类  
 <a href="class_file.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_file_8h_source.html">File.h</a>&gt;</code></p>
<div class="dynheader">
类 File 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_file.png" usemap="#File_map" alt=""/>
  <map id="File_map" name="File_map">
<area href="class_i_o_device.html" title="IO设备抽象类 " alt="IODevice" shape="rect" coords="0,0,65,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ae039af5807fc385f41b60644725d15d0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#ae039af5807fc385f41b60644725d15d0">File</a> ()</td></tr>
<tr class="memdesc:ae039af5807fc385f41b60644725d15d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">File构造函数  <a href="#ae039af5807fc385f41b60644725d15d0">更多...</a><br /></td></tr>
<tr class="separator:ae039af5807fc385f41b60644725d15d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03e9a7af98449e967da0bce822691b6d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03e9a7af98449e967da0bce822691b6d"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>File</b> (const std::string fileName, sint32 ioMode)</td></tr>
<tr class="separator:a03e9a7af98449e967da0bce822691b6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50677171d2d118707a394c6d8480fd14"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a50677171d2d118707a394c6d8480fd14">open</a> (const char *fileName, sint32 ioMode)</td></tr>
<tr class="memdesc:a50677171d2d118707a394c6d8480fd14"><td class="mdescLeft">&#160;</td><td class="mdescRight">打开文件  <a href="#a50677171d2d118707a394c6d8480fd14">更多...</a><br /></td></tr>
<tr class="separator:a50677171d2d118707a394c6d8480fd14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aabaf3655ddb4e02ea3e2cf5dcdae9391"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#aabaf3655ddb4e02ea3e2cf5dcdae9391">close</a> ()</td></tr>
<tr class="memdesc:aabaf3655ddb4e02ea3e2cf5dcdae9391"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭文件  <a href="#aabaf3655ddb4e02ea3e2cf5dcdae9391">更多...</a><br /></td></tr>
<tr class="separator:aabaf3655ddb4e02ea3e2cf5dcdae9391"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc4f13b8aa0bd807cd04a760a3307883"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#acc4f13b8aa0bd807cd04a760a3307883">readData</a> (char *buf, sint32 count, sint32 timeoutMs=-1)</td></tr>
<tr class="memdesc:acc4f13b8aa0bd807cd04a760a3307883"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取数据  <a href="#acc4f13b8aa0bd807cd04a760a3307883">更多...</a><br /></td></tr>
<tr class="separator:acc4f13b8aa0bd807cd04a760a3307883"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5734005c02e9ff422a10ea23a887c64"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#aa5734005c02e9ff422a10ea23a887c64">writeData</a> (const char *buf, sint32 count, sint32 timeoutMs=-1)</td></tr>
<tr class="memdesc:aa5734005c02e9ff422a10ea23a887c64"><td class="mdescLeft">&#160;</td><td class="mdescRight">写入数据  <a href="#aa5734005c02e9ff422a10ea23a887c64">更多...</a><br /></td></tr>
<tr class="separator:aa5734005c02e9ff422a10ea23a887c64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af71959af78983c4cd0e6a3dd8f262b8b"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#af71959af78983c4cd0e6a3dd8f262b8b">setAttribute</a> (sint32 attr, sint32 value)</td></tr>
<tr class="memdesc:af71959af78983c4cd0e6a3dd8f262b8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置属性  <a href="#af71959af78983c4cd0e6a3dd8f262b8b">更多...</a><br /></td></tr>
<tr class="separator:af71959af78983c4cd0e6a3dd8f262b8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18d35277983223591f1d2f3513b91c2c"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a18d35277983223591f1d2f3513b91c2c">getAttribute</a> (sint32 attr)</td></tr>
<tr class="memdesc:a18d35277983223591f1d2f3513b91c2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取属性  <a href="#a18d35277983223591f1d2f3513b91c2c">更多...</a><br /></td></tr>
<tr class="separator:a18d35277983223591f1d2f3513b91c2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27b9a220e5178174b0e3cfab7e93e8a4"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a27b9a220e5178174b0e3cfab7e93e8a4">mapMemory</a> ()</td></tr>
<tr class="memdesc:a27b9a220e5178174b0e3cfab7e93e8a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">将文件映射到内存  <a href="#a27b9a220e5178174b0e3cfab7e93e8a4">更多...</a><br /></td></tr>
<tr class="separator:a27b9a220e5178174b0e3cfab7e93e8a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1570e9a2cd280f43b53478f93cf0d55d"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a1570e9a2cd280f43b53478f93cf0d55d">unmapMemory</a> ()</td></tr>
<tr class="memdesc:a1570e9a2cd280f43b53478f93cf0d55d"><td class="mdescLeft">&#160;</td><td class="mdescRight">解除文件内存映射  <a href="#a1570e9a2cd280f43b53478f93cf0d55d">更多...</a><br /></td></tr>
<tr class="separator:a1570e9a2cd280f43b53478f93cf0d55d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27c733cf7c46adb52193a125e383d43f"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a27c733cf7c46adb52193a125e383d43f">readLine</a> (std::string &amp;lineStr)</td></tr>
<tr class="memdesc:a27c733cf7c46adb52193a125e383d43f"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取一行数据  <a href="#a27c733cf7c46adb52193a125e383d43f">更多...</a><br /></td></tr>
<tr class="separator:a27c733cf7c46adb52193a125e383d43f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f89b8ebe861302af393e67bfcd5cca8"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a2f89b8ebe861302af393e67bfcd5cca8">getSize</a> ()</td></tr>
<tr class="memdesc:a2f89b8ebe861302af393e67bfcd5cca8"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件大小  <a href="#a2f89b8ebe861302af393e67bfcd5cca8">更多...</a><br /></td></tr>
<tr class="separator:a2f89b8ebe861302af393e67bfcd5cca8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e324b9cb28fc557b92901f2481ce0fb"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a9e324b9cb28fc557b92901f2481ce0fb">getName</a> ()</td></tr>
<tr class="memdesc:a9e324b9cb28fc557b92901f2481ce0fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件名称  <a href="#a9e324b9cb28fc557b92901f2481ce0fb">更多...</a><br /></td></tr>
<tr class="separator:a9e324b9cb28fc557b92901f2481ce0fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a338c00e6b120d72276bcd23834107fac"><td class="memItemLeft" align="right" valign="top">FILE *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a338c00e6b120d72276bcd23834107fac">getFp</a> ()</td></tr>
<tr class="memdesc:a338c00e6b120d72276bcd23834107fac"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件句柄  <a href="#a338c00e6b120d72276bcd23834107fac">更多...</a><br /></td></tr>
<tr class="separator:a338c00e6b120d72276bcd23834107fac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61d8d4362419a50b3583f9bc66967c54"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a61d8d4362419a50b3583f9bc66967c54">getFd</a> ()</td></tr>
<tr class="memdesc:a61d8d4362419a50b3583f9bc66967c54"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件描述符  <a href="#a61d8d4362419a50b3583f9bc66967c54">更多...</a><br /></td></tr>
<tr class="separator:a61d8d4362419a50b3583f9bc66967c54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae405a9cb0b035553be7fafef53041daf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#ae405a9cb0b035553be7fafef53041daf">isEnd</a> ()</td></tr>
<tr class="memdesc:ae405a9cb0b035553be7fafef53041daf"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断是否已经到文件尾部  <a href="#ae405a9cb0b035553be7fafef53041daf">更多...</a><br /></td></tr>
<tr class="separator:ae405a9cb0b035553be7fafef53041daf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00afbd8a2fccab897a7cc33516e0e73d"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a00afbd8a2fccab897a7cc33516e0e73d">getPos</a> ()</td></tr>
<tr class="memdesc:a00afbd8a2fccab897a7cc33516e0e73d"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前读写位置  <a href="#a00afbd8a2fccab897a7cc33516e0e73d">更多...</a><br /></td></tr>
<tr class="separator:a00afbd8a2fccab897a7cc33516e0e73d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57efa4841cef95ba4f7b872f79f85cf9"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a57efa4841cef95ba4f7b872f79f85cf9">setPos</a> (sint32 pos)</td></tr>
<tr class="memdesc:a57efa4841cef95ba4f7b872f79f85cf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置当前读写位置  <a href="#a57efa4841cef95ba4f7b872f79f85cf9">更多...</a><br /></td></tr>
<tr class="separator:a57efa4841cef95ba4f7b872f79f85cf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a1591f333f18f94a7d2239b428d66af6a"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#a1591f333f18f94a7d2239b428d66af6a">isDirEmpty</a> (const char *dirName)</td></tr>
<tr class="memdesc:a1591f333f18f94a7d2239b428d66af6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断目录是否为空  <a href="#a1591f333f18f94a7d2239b428d66af6a">更多...</a><br /></td></tr>
<tr class="separator:a1591f333f18f94a7d2239b428d66af6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbe554337807475130c58883da57fbb6"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#abbe554337807475130c58883da57fbb6">isExist</a> (const char *fileName)</td></tr>
<tr class="memdesc:abbe554337807475130c58883da57fbb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断文件或文件夹是否存在  <a href="#abbe554337807475130c58883da57fbb6">更多...</a><br /></td></tr>
<tr class="separator:abbe554337807475130c58883da57fbb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8e5fba482c6df8c78cc53f5d16493c9"><td class="memItemLeft" align="right" valign="top">static sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file.html#aa8e5fba482c6df8c78cc53f5d16493c9">getContentSize</a> (const char *fileName)</td></tr>
<tr class="memdesc:aa8e5fba482c6df8c78cc53f5d16493c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取内容大小  <a href="#aa8e5fba482c6df8c78cc53f5d16493c9">更多...</a><br /></td></tr>
<tr class="separator:aa8e5fba482c6df8c78cc53f5d16493c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pro_attribs_class_i_o_device"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_i_o_device')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="class_i_o_device.html">IODevice</a></td></tr>
<tr class="memitem:a5ab8e2aa83ad8a53d8ddbb19b23d3688 inherit pro_attribs_class_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5ab8e2aa83ad8a53d8ddbb19b23d3688"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_fd</b></td></tr>
<tr class="separator:a5ab8e2aa83ad8a53d8ddbb19b23d3688 inherit pro_attribs_class_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4900690afb4b4d17f90cfe3a9fb504e inherit pro_attribs_class_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa4900690afb4b4d17f90cfe3a9fb504e"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>m_devName</b></td></tr>
<tr class="separator:aa4900690afb4b4d17f90cfe3a9fb504e inherit pro_attribs_class_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e930bf51c6a266e5be5b2ed62c7ecfa inherit pro_attribs_class_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5e930bf51c6a266e5be5b2ed62c7ecfa"></a>
sint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_openMode</b></td></tr>
<tr class="separator:a5e930bf51c6a266e5be5b2ed62c7ecfa inherit pro_attribs_class_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>文件类 </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="ae039af5807fc385f41b60644725d15d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">File::File </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>File构造函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="aabaf3655ddb4e02ea3e2cf5dcdae9391"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>关闭文件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>文件关闭成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>重载 <a class="el" href="class_i_o_device.html#a1120c9e7a7c4d0b23083effbe4cb6279">IODevice</a> .</p>

</div>
</div>
<a class="anchor" id="a18d35277983223591f1d2f3513b91c2c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::getAttribute </td>
          <td>(</td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>attr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>读取属性 </p>
<dl class="section return"><dt>返回</dt><dd>返回0或1表示该属性值 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>File只支持可读及可写两个属性 </dd></dl>

<p>实现了 <a class="el" href="class_i_o_device.html">IODevice</a>.</p>

</div>
</div>
<a class="anchor" id="aa8e5fba482c6df8c78cc53f5d16493c9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::getContentSize </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>fileName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取内容大小 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">filePath</td><td>文件名或文件夹名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回文件或文件夹的大小 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a61d8d4362419a50b3583f9bc66967c54"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::getFd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取文件描述符 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回当前文件描述符 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a338c00e6b120d72276bcd23834107fac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FILE * File::getFp </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取文件句柄 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回当前文件句柄(FILE*) </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a9e324b9cb28fc557b92901f2481ce0fb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string File::getName </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取文件名称 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回当前文件名称 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a00afbd8a2fccab897a7cc33516e0e73d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::getPos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前读写位置 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回当前读写位置,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a2f89b8ebe861302af393e67bfcd5cca8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::getSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取文件大小 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回文件大小,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a1591f333f18f94a7d2239b428d66af6a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool File::isDirEmpty </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dirName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断目录是否为空 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td>目录全名(如:/usr/share) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>目录为空或不存在返回true,不为空则返回false </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ae405a9cb0b035553be7fafef53041daf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool File::isEnd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>判断是否已经到文件尾部 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>是返回true,否返回false </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="abbe554337807475130c58883da57fbb6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool File::isExist </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filePath</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断文件或文件夹是否存在 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">filePath</td><td>文件名或文件夹名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>文件存在返回true,否则返回false </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a27b9a220e5178174b0e3cfab7e93e8a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * File::mapMemory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将文件映射到内存 </p>
<dl class="section return"><dt>返回</dt><dd>映射成功返回地址,失败返回NULL </dd></dl>
<dl class="section note"><dt>注解</dt><dd>在使用mapMemery时,请不要使用readData,writeData这些接口 </dd></dl>

</div>
</div>
<a class="anchor" id="a50677171d2d118707a394c6d8480fd14"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::open </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>fileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>ioMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>打开文件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>文件全名(包含路径,如:/etc/init.d/rcS) </td></tr>
    <tr><td class="paramname">ioMode</td><td>打开模式IO_MODE_E </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>文件打开成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>重载 <a class="el" href="class_i_o_device.html#a426aac91300f077d57b1f30c76c7c430">IODevice</a> .</p>

</div>
</div>
<a class="anchor" id="acc4f13b8aa0bd807cd04a760a3307883"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::readData </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>timeoutMs</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>读取数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>数据缓存 </td></tr>
    <tr><td class="paramname">count</td><td>要读取的长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回读取的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>实现了 <a class="el" href="class_i_o_device.html">IODevice</a>.</p>

</div>
</div>
<a class="anchor" id="a27c733cf7c46adb52193a125e383d43f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::readLine </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>lineStr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>读取一行数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">lineStr</td><td>该行字符串 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回读取的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="af71959af78983c4cd0e6a3dd8f262b8b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::setAttribute </td>
          <td>(</td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>attr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置属性 </p>
<dl class="section return"><dt>返回</dt><dd>STATUS_ERRROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>File无属性 </dd></dl>

<p>实现了 <a class="el" href="class_i_o_device.html">IODevice</a>.</p>

</div>
</div>
<a class="anchor" id="a57efa4841cef95ba4f7b872f79f85cf9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::setPos </td>
          <td>(</td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>pos</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置当前读写位置 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a1570e9a2cd280f43b53478f93cf0d55d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::unmapMemory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>解除文件内存映射 </p>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_OK </dd></dl>
<dl class="section note"><dt>注解</dt><dd>在使用mapMemery时,请不要使用readData,writeData这些接口 </dd></dl>

</div>
</div>
<a class="anchor" id="aa5734005c02e9ff422a10ea23a887c64"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 File::writeData </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>timeoutMs</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>写入数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>数据缓存 </td></tr>
    <tr><td class="paramname">count</td><td>要写入的长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回写入的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

<p>实现了 <a class="el" href="class_i_o_device.html">IODevice</a>.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>libemb/inc/<a class="el" href="_file_8h_source.html">File.h</a></li>
<li>libemb/src/File.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:38 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
